function getHierarchyInfo() {
  let elements = document.querySelectorAll('*');
  let hierarchyData = [];

  elements.forEach(element => {
    hierarchyData.push({
      tagName: element.tagName,
      id: element.id,
      classList: Array.from(element.classList)
    });
  });

  return hierarchyData;
}

chrome.runtime.sendMessage({
  action: "getHierarchyInfo",
  data: getHierarchyInfo()
}, function(response) {
  console.log("Response from background script:", response);
});
